package com.aos.erp.schools.rpc.school;


import com.aos.erp.common.bean.ResultEntity;
import com.aos.erp.common.exception.BizException;
import com.aos.erp.schools.model.gatherschool.entity.GatherSchool;
import com.aos.erp.schools.model.gatherschool.ro.DevRo;
import com.aos.erp.schools.service.gatherschool.GatherSchoolService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 傲雄驾校管理 前端控制器
 * </p>
 *
 * @author 杨文博
 * @since 2018-12-02
 */
@Slf4j
@RestController
@RequestMapping("/service/school")
@Api(value="rpc傲雄驾校管理",tags={"rpc傲雄驾校管理"})
public class SchoolController {

	@Autowired
	private GatherSchoolService gatherSchoolService;

	@GetMapping("/getSchoolByDev")
	@ApiOperation(value = "根据设备查询驾校")
	public ResultEntity<List<GatherSchool>>  getSchoolByDev(String usbKey,String deviceCode) throws BizException {
		DevRo devRo=new DevRo();
		devRo.setDeviceCode(deviceCode);
		devRo.setUsbKey(usbKey);
		List<GatherSchool>  SchoolTree=gatherSchoolService.getSchoolByDev(devRo);
		return ResultEntity.success(SchoolTree);
	}


}

